package com.chris.homecare.components
{
	import com.chris.homecare.TextureAtlasManager;
	import com.chris.homecare.utils.CommonUtils;
	
	import feathers.controls.Label;
	import feathers.controls.LayoutGroup;
	import feathers.layout.HorizontalLayout;
	
	import starling.display.Image;
	
	public class BulletHeadingComp extends LayoutGroup
	{
		private var headingImg:Image;
		private var headingLabel:Label;
		
		private var headingText:String;

		public function BulletHeadingComp(heading:String)
		{
			super();
			
			headingText = heading;
		}
		
		override protected function initialize():void
		{
			var contentGroup:LayoutGroup = new LayoutGroup();
			addChild(contentGroup);
			
			var horLayout:HorizontalLayout = new HorizontalLayout();
			horLayout.verticalAlign = HorizontalLayout.VERTICAL_ALIGN_MIDDLE;
			horLayout.gap = 10;
			horLayout.paddingTop = 6;
			horLayout.paddingLeft = 20;
			horLayout.paddingBottom = 6;
			contentGroup.layout = horLayout;
			
			headingImg = new Image(TextureAtlasManager.getAtlas().getTexture("heading-icon"));
			headingImg.width = headingImg.height = 60*CommonUtils.scaleValue;
			contentGroup.addChild(headingImg);
			
			headingLabel = new Label();
			headingLabel.nameList.add("screen-heading-label");
			headingLabel.text = headingText;
			contentGroup.addChild(headingLabel);
			
			super.initialize();
		}
		
		override protected function draw():void
		{
			this.width = stage.stageWidth;
			
			super.draw();
		}
		
	}
}